# coding: utf-8
import sys
from PySide6.QtCore import QUrl
from PySide6.QtWidgets import QWidget, QVBoxLayout, QApplication
from qfluentwidgets.multimedia import VideoWidget


class Demo2(QWidget):

    def __init__(self):
        super().__init__()
        self.vBoxLayout = QVBoxLayout(self)
        self.videoWidget = VideoWidget(self)
        url = 'https://p16-tiktok-sg-h2.ibyteimg.com/obj/tos-alisg-ve-0051c001-sg/oInB4uDqFnXY7bt5ANYeABHDEn4IEQRfgnW8BE?x-expires=1748506549&x-signature=MDA4OWIwMWMzNTU4ODFkNDc5MWU'
        self.videoWidget.setVideo(QUrl(url))
        self.videoWidget.play()

        self.vBoxLayout.setContentsMargins(0, 0, 0, 0)
        self.vBoxLayout.addWidget(self.videoWidget)
        self.resize(800, 450)


if __name__ == '__main__':
    app = QApplication(sys.argv)
    demo = Demo2()
    demo.show()
    sys.exit(app.exec())
